package main

/*
#include "hello.h"
*/

import "C"
import (
	"fmt"
	"time"
	"unsafe"
)

//export hello
func hello() {
	fmt.Println("Hello, World!")
}

//export send_data
func send_data(data *C.uchar, length C.int) {
	// Convert C uchar pointer to Go byte slice
	slice := unsafe.Slice((*byte)(data), length)
	fmt.Println("Sending data:", string(slice), length)
}

func init() {
	fmt.Println("golang so init")
	time.Sleep(time.Second)
	fmt.Println("golang so init end")
	go func() {
		for {
			time.Sleep(time.Second)
			fmt.Println("golang goroutine run")
		}

	}()
}

func main() {

}
